package cn.wizzer.app.user.modules.models.enums;


import cn.wizzer.framework.util.Result;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 申请入群记录枚举
 *
 * @author .
 */

public enum GroupApplyEnum {
    //
    APPLYING("申请中", -1),
    REFUSED("已拒绝", 0),
    AGREED("已同意", 1),
    ;

    final public String NAME;
    final public int VALUE;

    GroupApplyEnum(String name, int value) {
        NAME = name;
        VALUE = value;
    }

    public String getName() {
        return NAME;
    }

    public int getValue() {
        return VALUE;
    }

    public static List<Map<Object, Object>> toList(){
        GroupApplyEnum[] values = GroupApplyEnum.values();
        return Arrays.stream(values).map(enu -> Result.createHashMap("name", enu.NAME, "value", enu.toString()))
                .collect(Collectors.toList());
    }
}
